<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
    <title>cssTab切换2</title>
    <style type="text/css">
        *{
            margin: 0;
            padding: 0;
            text-decoration: none;
        }
        .tab{
            width: 300px;
            height: 300px;
            margin: 30px auto;
            overflow: hidden;
        }
        .nav{
            height: 30px
        }
        .content{
            height: 270px;
            overflow: hidden;
        }
        .cont{
            height: 270px;
        }
        #the1{
            background: #666;
        }
        #the2{
            background: #aaa;
        }
    </style>
</head>
<body>
<div class="tab">
    <div class="nav">
        <a href="#the1">ONE</a>
        <a href="#the2">TWO</a>
    </div>
    <div class="content">
        <div id="the1" class="cont">第一张</div>
        <div id="the2" class="cont">第二张</div>
    </div>
</div>
</body>
</html>